home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PCGUIA 10
/
PC Guia 10.iso
/
database
/
shared.dir
/
01039_Script_1039
< prev
next >
Wrap
Text File
|
1996-03-14
|
6KB
|
234 lines
-- clicked on the nav button
on ChapterClick
global gCurType, gQTstatus
-- if we're in a QT article then kill the QT
if gCurType = "qt" or gCurType = "movie" and the framelabel = "qt" then
if the movierate of sprite 16 then
set gQTstatus = 1
else
set gQTstatus = 0
end if
set the movierate of sprite 16 = 0
puppetsprite 16,1
set the loch of sprite 16 = 1000
end if
ClickSnd
updatestage
NavButtonWindow
EndTrapMouse
end
-----------------------------------------------------------------------------------------
on NavButtonClose
global gCurType
if not rollover(33) then
if the puppet of sprite 33 then
set the loch of sprite 33 = 1000
set the loch of sprite 34 = 1000
updatestage
puppetsprite 33,0
puppetsprite 34,0
end if
end if
if the framelabel = "qt" and gCurType = "movie" or gCurType = "qt" then
puppetsprite 16,0
end if
end
-----------------------------------------------------------------------------------------
on NavButtonWindow
global gWorld
puppetsprite 33,1
puppetsprite 34,1
if gWorld = "senses" then
set the loch of sprite 33 = 428
set the loch of sprite 34 = 433
else if gWorld = "body" then
set the loch of sprite 33 = 358
set the loch of sprite 34 = 361
else if gWorld = "design" then
set the loch of sprite 33 = 352
set the loch of sprite 34 = 355
else if gWorld = "power" then
set the loch of sprite 33 = 327
set the loch of sprite 34 = 330
else if gWorld = "discover" then
set the loch of sprite 33 = 439
set the loch of sprite 34 = 442
else if gWorld = "mind" then
set the loch of sprite 33 = 431
set the loch of sprite 34 = 433
end if
set the height of sprite 33 = the height of cast "chaptertitles" + 10
end
-----------------------------------------------------------------------------------------
on NavButtonUpdate
global gCurChap, gCurArticle, gArticles
set numarticles = count(getat(garticles,gcurchap))
set the text of field "CurrentChapter" = line gcurchap of field "chaptertitles"
set the text of field "CurrentArticle" = gcurarticle && "of" && numarticles
-- if only 1 article
if numarticles = 1 then
set the visible of sprite 35 = 0
set the visible of sprite 36 = 0
-- puppetsprite 35,1
-- puppetsprite 36,1
-- set the loch of sprite 35 = 1000
-- set the loch of sprite 36 = 1000
else
set the visible of sprite 35 = 1
set the visible of sprite 36 = 1
end if
end
-----------------------------------------------------------------------------------------
on DoNugget
global gNuggetTime, gNuggetDelay, gNuggetOn, gWhichNugget, gMaxNuggets, gStartNuggetCast
global gInAMap
if gInAMap then exit -- no nuggets while on the maps, because of the transitions
if gWhichNugget < 0 then exit
if the framelabel = "qt" then exit -- no nuggets on the qt
if the framelabel = "facts" then exit -- no nuggets on the flying facts screen
set the itemdelimiter = "."
set tmp = item 2 of the framelabel
set the itemdelimiter = ","
if tmp = "anim" then -- no nuggets on the animations
exit
end if
if not gNuggetOn then
if (the ticks - gNuggetTime) > gNuggetDelay then
set gNuggetOn = 1
else
exit
end if
end if
set nsp = 47 -- nugget sprite
set speed = 5
if not the puppet of sprite 47 then
set gStartNuggetCast = the castnum of sprite 47
puppetsprite 47,1
set the loch of sprite 47 = 635
set the locv of sprite 47 = 100 + random(200)
else
-- rotate through the nugget casts
set tmp = the castnum of sprite 47
if the name of cast tmp = "nugget6" then set tmp = gStartNuggetCast
else set tmp = tmp+1
set the castnum of sprite 47 = tmp
set the loch of sprite 47 = the loch of sprite 47 - speed
if the loch of sprite 47 < 0 then
set gNuggetOn = 0
set gNuggetTime = the ticks
puppetsprite 47,0
end if
end if
end
-------------------------------------------------------------------------
-- when user clicks on nugget sprite, this gets run
on ShowNugget
global gWhichNugget, gNuggets, gMaxNuggets, gNuggetOn, gNuggetTime, gNuggetList
ClickSnd
updatestage
if gNuggetOn = 2 then exit
set gNuggetOn = 2
set nsb = 46 -- blank
set nsp = 47 -- box
set nspt = 48 -- text
set the itemdelimiter = "#"
set the text of field "nuggettext" = item gWhichNugget of gNuggets
set the itemdelimiter = ","
set h = the height of cast "nuggettext"
set w = the width of cast "nuggettext"
set x = the loch of sprite nsp
set y = the locv of sprite nsp
put x && y
if x < 50 then
set x = 50
else if x > 350 then
set x = 350
end if
if y < 50 then
set y = 50
else if y > 400 then
set y = 400
end if
put x && y
-- set x = 200
-- set y = 150
set the castnum of sprite nsp = the number of cast "nuggetback"
spritebox nsp,x-15,y-15,(x+w+15),(y+h+15)
set the loch of sprite nspt = x
set the locv of sprite nspt = y
-- loop until the user does a mouseclick
set temptime = the ticks
repeat while the mousedown
updatestage
end repeat
repeat while (the ticks - temptime) < 30
updatestage
end repeat
repeat while not the mousedown
updatestage
end repeat
-- get rid of the nugget
set gNuggetOn = 0
set gNuggetTime = the ticks
set the loch of sprite nsp = 1000
set the loch of sprite nspt = 1000
updatestage
puppetsprite nsp,0
puppetsprite nspt,0
set gWhichNugget = random(gMaxNuggets)
set tmp = count(gNuggetList)
if tmp >= gMaxNuggets then
set gWhichNugget = -1
else
repeat while getpos(gNuggetList,gWhichNugget)
set gWhichNugget = random(gMaxNuggets)
end repeat
add(gNuggetList,gWhichNugget)
end if
EndTrapMouse
end